package com.lantosec.hmrp.modules.workflow.enumeration;


/**
 * 任务操作者类型
 */
public enum TaskOperatorTypeEnum {
    // 操作类型，指定，上级管理岗，部门管理岗，部门管理人，角色，SQL
    DESIGNATION("DESIGNATION","指定"),
    SUPERIOR("SUPERIOR", "上级管理岗"),
    DEPARTMENT("DEPARTMENT", "部门管理岗"),
    MANAGER("MANAGER", "部门管理人"),
    ROLE("ROLE", "角色"),
    SQL("SQL", "SQL语句");

    private String type;
    private String name;

    private TaskOperatorTypeEnum(String type, String name) {
        this.type = type;
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static TaskOperatorTypeEnum getByType(String type) {
        for (TaskOperatorTypeEnum item : TaskOperatorTypeEnum.values()) {
            if (item.getType().equals(type)) {
                return item;
            }
        }
        return TaskOperatorTypeEnum.DESIGNATION;
    }
}
